package com.yqb.study.modular.warpper;

import java.util.HashMap;
import java.util.Map;

import com.yqb.study.common.warpper.BaseWarpper;
import com.yqb.study.constant.cache.IDictFactory;
import com.yqb.study.constant.cache.impl.DictFactory;
import com.yqb.study.util.ToolUtil;

/**
 * 城市列表的包装类
 */
public class CityWarpper extends BaseWarpper {

	public CityWarpper(Object list) {
		super(list);
	}

	@Override
	public void warpTheMap(Map<String, Object> map) {

		String provinceId = map.get("province_id").toString();

		Map<String, String> provinceDict = DictFactory.me().getNum2NameDicts("省份");

		if (ToolUtil.isNotEmpty(provinceDict)) {
			map.put("provinceName", provinceDict.get(provinceId));
		}
	}
}
